```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>API网关路由类型解析</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero {
            background: linear-gradient(135deg, #6e8efb, #a777e3);
        }
        .card {
            transition: all 0.3s ease;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .route-icon {
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            margin-bottom: 1rem;
            color: white;
            font-size: 1.5rem;
        }
        .highlight {
            background: linear-gradient(to right, #a777e3, #6e8efb);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }
        .footer {
            background-color: #1a202c;
        }
        .footer a:hover {
            color: #a777e3;
            transition: color 0.3s ease;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero text-white py-20 px-4 md:py-28">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-6">API 网关路由类型解析</h1>
                    <p class="text-xl mb-8 opacity-90">探索现代 API 网关中的路由机制与最佳实践</p>
                    <div class="flex space-x-4">
                        <a href="#content" class="bg-white text-indigo-600 px-6 py-3 rounded-lg font-medium hover:bg-gray-100 transition duration-300">
                            <i class="fas fa-book-open mr-2"></i>开始阅读
                        </a>
                        <a href="#visualization" class="bg-transparent border-2 border-white px-6 py-3 rounded-lg font-medium hover:bg-white hover:text-indigo-600 transition duration-300">
                            <i class="fas fa-project-diagram mr-2"></i>数据可视化
                        </a>
                    </div>
                </div>
                <div class="md:w-1/2">
                    <div class="bg-white bg-opacity-20 p-6 rounded-xl backdrop-filter backdrop-blur-sm">
                        <div class="mermaid">
                            graph TD
                                A[API 网关] --> B[路由类型]
                                B --> C1[静态路由]
                                B --> C2[动态路由]
                                B --> C3[基于请求路径]
                                B --> C4[基于请求头]
                                B --> C5[基于请求方法]
                                B --> C6[基于请求参数]
                                B --> C7[基于权重]
                                B --> C8[基于负载均衡]
                                B --> C9[基于优先级]
                                B --> C10[基于地理位置]
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <section id="content" class="py-16 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">API 网关中的<span class="highlight">路由类型</span></h2>
                <p class="text-lg text-gray-600 max-w-3xl mx-auto">路由是 API 网关的核心功能之一，负责将客户端请求转发到具体的服务实例。不同的网关支持不同的路由种类和配置方式。</p>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
                <!-- 静态路由 -->
                <div class="card bg-white p-6">
                    <div class="route-icon bg-purple-500">
                        <i class="fas fa-file-alt"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">1. 静态路由</h3>
                    <p class="text-gray-600 mb-4">网关在启动时加载配置文件或代码中的静态路由规则，运行时不会发生变化。</p>
                    <div class="bg-gray-100 p-4 rounded-lg">
                        <code class="text-sm text-gray-800">
                            /api/users → http://localhost:8080/users
                        </code>
                    </div>
                </div>

                <!-- 动态路由 -->
                <div class="card bg-white p-6">
                    <div class="route-icon bg-blue-500">
                        <i class="fas fa-sync-alt"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">2. 动态路由</h3>
                    <p class="text-gray-600 mb-4">在运行时根据实时数据或配置动态调整路由规则，适用于需要动态调整的场景。</p>
                    <div class="bg-gray-100 p-4 rounded-lg">
                        <code class="text-sm text-gray-800">
                            从数据库或配置中心读取路由配置
                        </code>
                    </div>
                </div>

                <!-- 基于请求路径的路由 -->
                <div class="card bg-white p-6">
                    <div class="route-icon bg-green-500">
                        <i class="fas fa-road"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">3. 基于请求路径</h3>
                    <p class="text-gray-600 mb-4">根据请求 URL 的路径部分进行匹配，转发到不同的服务。</p>
                    <div class="bg-gray-100 p-4 rounded-lg">
                        <code class="text-sm text-gray-800">
                            /api/v1/orders → 订单服务<br>
                            /api/v1/users → 用户服务
                        </code>
                    </div>
                </div>

                <!-- 基于请求头的路由 -->
                <div class="card bg-white p-6">
                    <div class="route-icon bg-yellow-500">
                        <i class="fas fa-heading"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">4. 基于请求头</h3>
                    <p class="text-gray-600 mb-4">根据 HTTP 头部信息决定路由目标，如 X-Region、Accept-Language。</p>
                    <div class="bg-gray-100 p-4 rounded-lg">
                        <code class="text-sm text-gray-800">
                            X-Region: US → 美国服务<br>
                            X-Region: EU → 欧洲服务
                        </code>
                    </div>
                </div>

                <!-- 基于请求方法的路由 -->
                <div class="card bg-white p-6">
                    <div class="route-icon bg-red-500">
                        <i class="fas fa-exchange-alt"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">5. 基于请求方法</h3>
                    <p class="text-gray-600 mb-4">根据 HTTP 方法(GET、POST等)决定路由目标。</p>
                    <div class="bg-gray-100 p-4 rounded-lg">
                        <code class="text-sm text-gray-800">
                            GET → 查询服务<br>
                            POST → 创建服务
                        </code>
                    </div>
                </div>

                <!-- 基于请求参数的路由 -->
                <div class="card bg-white p-6">
                    <div class="route-icon bg-indigo-500">
                        <i class="fas fa-search"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">6. 基于请求参数</h3>
                    <p class="text-gray-600 mb-4">根据查询参数决定路由目标。</p>
                    <div class="bg-gray-100 p-4 rounded-lg">
                        <code class="text-sm text-gray-800">
                            /api/search?type=books → 图书服务<br>
                            /api/search?type=movies → 电影服务
                        </code>
                    </div>
                </div>

                <!-- 基于权重的路由 -->
                <div class="card bg-white p-6">
                    <div class="route-icon bg-pink-500">
                        <i class="fas fa-balance-scale"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">7. 基于权重</h3>
                    <p class="text-gray-600 mb-4">根据配置的权重将请求分发到不同服务实例，用于流量控制。</p>
                    <div class="bg-gray-100 p-4 rounded-lg">
                        <code class="text-sm text-gray-800">
                            80% → 服务实例A<br>
                            20% → 服务实例B
                        </code>
                    </div>
                </div>

                <!-- 基于负载均衡的路由 -->
                <div class="card bg-white p-6">
                    <div class="route-icon bg-teal-500">
                        <i class="fas fa-random"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">8. 基于负载均衡</h3>
                    <p class="text-gray-600 mb-4">将请求均匀分发到多个服务实例，实现负载均衡。</p>
                    <div class="bg-gray-100 p-4 rounded-lg">
                        <code class="text-sm text-gray-800">
                            轮询、随机、最少连接等算法
                        </code>
                    </div>
                </div>

                <!-- 基于优先级的路由 -->
                <div class="card bg-white p-6">
                    <div class="route-icon bg-orange-500">
                        <i class="fas fa-flag"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">9. 基于优先级</h3>
                    <p class="text-gray-600 mb-4">根据预定义优先级选择路由目标，高优先级规则优先处理。</p>
                    <div class="bg-gray-100 p-4 rounded-lg">
                        <code class="text-sm text-gray-800">
                            优先级高的处理紧急请求<br>
                            优先级低的处理普通请求
                        </code>
                    </div>
                </div>

                <!-- 基于地理位置的路由 -->
                <div class="card bg-white p-6">
                    <div class="route-icon bg-cyan-500">
                        <i class="fas fa-globe-americas"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">10. 基于地理位置</h3>
                    <p class="text-gray-600 mb-4">根据请求来源的地理位置路由到不同的服务。</p>
                    <div class="bg-gray-100 p-4 rounded-lg">
                        <code class="text-sm text-gray-800">
                            用户IP → 最近的数据中心<br>
                            或地区服务
                        </code>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Visualization Section -->
    <section id="visualization" class="py-16 px-4 bg-gray-100">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-12">
                <h2 class="text-3xl font-bold mb-4">路由类型<span class="highlight">关系图</span></h2>
                <p class="text-lg text-gray-600 max-w-3xl mx-auto">通过交互式图表探索不同路由类型之间的关系</p>
            </div>

            <div class="bg-white rounded-xl p-6 shadow-lg">
                <div class="mermaid text-center">
                    flowchart TD
                        Gateway[API 网关] --> Routing[路由类型]
                        Routing --> Static[静态路由\n配置文件预定义]
                        Routing --> Dynamic[动态路由\n运行时调整]
                        Routing --> Path[基于路径\n/api/users]
                        Routing --> Header[基于请求头\nX-Region: US]
                        Routing --> Method[基于方法\nGET/POST]
                        Routing --> Param[基于参数\n?type=books]
                        Routing --> Weight[基于权重\n80/20分配]
                        Routing --> LB[基于负载均衡\n轮询/随机]
                        Routing --> Priority[基于优先级\n紧急/普通]
                        Routing --> Geo[基于地理位置\n最近数据中心]
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="footer text-white py-12 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold mb-2">技术小馆</h3>
                    <p class="text-gray-400">探索技术的无限可能</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" target="_blank" class="text-gray-300 hover:text-white transition duration-300">
                        <i class="fas fa-link mr-2"></i>http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            },
            themeVariables: {
                primaryColor: '#6e8efb',
                primaryBorderColor: '#4f6aea',
                primaryTextColor: '#ffffff',
                lineColor: '#a777e3',
                secondaryColor: '#f0f0f0',
                tertiaryColor: '#ffffff'
            }
        });
    </script>
</body>
</html>
```